﻿@using thousandClear.Areas.Admin.Models;

@model List<ProjectModel>
<div id="app">
    <div class="ui-flex ui-box font-center bg-white" v-on:tap="back" style="padding: 10px 0px;">
        <span>推荐送服务</span>
    </div>
    <div class="ui-flex ui-box font-center">
        <div class="ui-box ui-flex" style="padding: 0px 10px;">
            <img class="ui-flex" src="~/Statics/Images/Activity/Activitytop.png" />
        </div>
        <ul>
            <li class="ui-flex" style="padding: 10px;">
                @*<div class="col40 font-red font-16">
                    <label style="line-height:30px;">
                        我的订单编号
                    </label>
                </div>*@
                <div class="ui-flex">
                    <input type="tel" placeholder="我的订单编号" v-model="AddressNo1" style="height: 28px; width: 80% ; border:1px solid red;">
                </div>
            </li>

            <li class="ui-flex" style="padding: 10px;">
                @*<div class="col40 font-red font-16">
                    <label style="line-height:30px;">
                        好友的订单编号
                    </label>
                </div>*@
                <div class="ui-flex">
                    <input type="tel" placeholder="好友的订单编号" v-model="AddressNo2" style="height: 28px; width: 80% ; border:1px solid red;">
                </div>
            </li>
            <li class="ui-flex" style="padding: 10px;">
                @*<div class="col40 font-red font-16">
                    <label style="line-height:30px;">
                        好友手机号
                    </label>
                </div>*@
                <div class="ui-flex">
                    <input type="tel" placeholder="好友手机号" v-model="Phone" style="height: 28px; width: 80% ; border:1px solid red;">
                </div>
            </li>
            <li class="ui-flex" style="padding: 10px;">
                <div class="font-red font-12">
                    <label style="line-height:30px;">
                        Tips:体验用户和单项用户不能参与此项活动哦！！
                    </label>
                </div>
            </li>
        </ul>
        <a class="font-white btn font-center" style="background: red; width:60%; display: block; margin-left: 20%; border-radius: 5px; padding: 10px 0px; " v-on:tap="submit">提交</a>

        <div class="ui-box ui-flex" style="padding: 0px 10px;">
            <img class="ui-flex" src="~/Statics/Images/Activity/Activitybottom.png" />
        </div>
    </div>

    <form id="form" method="post" action="">
        <input type="hidden" name="data" v-bind:value="data" />
    </form>

</div>



@section Styles{
    @Styles.Render("~/cssbundles/consumer/subscribe")
    <style>
        input::-moz-placeholder {
            color: red;
        }

        input::-webkit-input-placeholder {
            color: red;
        }

        input:-ms-input-placeholder {
            color: red;
        }
    </style>
}

@section Scripts{
    @Scripts.Render("~/jsbundles/consumer/subscribe")
    <script src="~/Statics/Venders/uedit-1.4.3.1/ueditor.parse.min.js"></script>
    <script>
        var model = new Vue({
            el: '#app',
            data: {
                AddressNo1: '',
                AddressNo2: '',
                Phone: '',
            },
            computed: {
                data: function () {
                    return JSON.stringify(this._data);
                }
            },
            methods: {
                submit: function () {
                    if (this.AddressNo2 == this.AddressNo1) {
                        alert("亲！订单号不能一样！");
                        return
                    }
                    $.ajax({
                        type: "get",
                        data: {
                            dilAddressNoGive: this.AddressNo2,
                            dilAddressNoGet: this.AddressNo1
                        },
                        url: "../Activity/Activity",
                        contentType: "application/json",
                        success: function (data) {
                            if (data == 1) {
                                alert("邀请成功！");
                                window.location.reload();
                            }
                            else if (data == 2) {
                                alert("被推荐人订单编号已被使用过");
                            }
                            else if (data == 3) {
                                alert("无推荐人订单编号");
                            }
                            else if (data == 4) {
                                alert("无被推荐人订单编号");
                            }
                            else if (data == 5) {
                                alert("推荐人订单不是签约订单");
                            }
                            else if (data == 6) {
                                alert("被推荐人订单不是签约订单");
                            }
                            else if (data == 7) {
                                alert("亲！不能自己邀请自己的哟。");

                            }
                        },
                        error: function (a, b) {
                            alert(a.status);
                        }

                    })
                },

            }

        })


    </script>
}